#pragma once

#include <OIS.h>
#include <Ogre.h>
#include <map>
#include <string>

using namespace std;

class Simulation;
class Pong3D;

class InputHandler :
	public OIS::MouseListener,
	public OIS::KeyListener,
	public OIS::JoyStickListener
{
private:
	//OIS Input devices
	OIS::InputManager *m_ois;
	OIS::Mouse *mMouse;
	OIS::Keyboard *mKeyboard;
	OIS::JoyStick *mJoy;

	Pong3D *mPong3D;
	Ogre::RenderWindow* mWindow;
public:
	InputHandler(Ogre::RenderWindow *window);
	~InputHandler();

	void setWindowExtents(int width, int height);
	void capture();

	// MouseListener
	bool mouseMoved(const OIS::MouseEvent &evt);
	bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID);
	bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID);
	
	// KeyListener
	bool keyPressed(const OIS::KeyEvent &evt);
	bool keyReleased(const OIS::KeyEvent &evt);
	
	// JoyStickListener
	bool buttonPressed(const OIS::JoyStickEvent &evt, int index);
	bool buttonReleased(const OIS::JoyStickEvent &evt, int index);
	bool axisMoved(const OIS::JoyStickEvent &evt, int index);
	bool povMoved(const OIS::JoyStickEvent &evt, int index);

};
